package com.west.common.bean;

import static android.R.id.message;

public class BaseBean<T> {
    public static final int RESULT_SUCCESS = 200;    //成功
    public static final int RESULT_UNKNOW = 0;
    public static final int RESULT_ERROR = -1;
    public static final int RESULT_NOT_FIND = 404;
    public static final int RESULT_NOT_LOGIN = 10036;    //未登录
    public static final int RESULT_TOKEN_EXPRIED = 202;
    public static final int RESULT_NOT_PERMISSION = 203;
    private T data;
    private int code;
    private String msg;

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }


    public boolean isSuccess() {
        return code == RESULT_SUCCESS;
    }

    @Override
    public String toString() {
        return "code:" + code
                + " + message:" + message
                + " + data:" + data.toString();
    }
}
